import random
import string

def generate_verification_code():
    """生成一个由大小写字母组成的4位验证码"""
    characters = string.ascii_letters  # 获取所有大小写字母
    verification_code = ''.join(random.choice(characters) for _ in range(4))  # 从字母中随机选择4个字符
    return verification_code

if __name__ == "__main__":
    verification_code = generate_verification_code()
    print("生成的验证码为:", verification_code)
